<?php echo $header;?>
<div id="content">
  <div class="box">
   <div class="heading">
      <h1><img src="view/image/information.png" alt="" /> <?php echo $heading_title; ?></h1>
      <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a href="<?php echo $cancel; ?>" class="button"><?php echo $button_cancel; ?></a></div>
    </div>
     <div class="content">
      <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form">
		<table class="form">
	      <tr>
		    <td><span class="required">*</span> <?php echo "姓名"; ?></td>
            	<td ><input  value="<?php echo $title;?>"   id="title" name="title" >
			</td>
			</tr>
			<tr>
			<td><span class="required">*</span> <?php echo "电话号码"; ?></td>
			 <td>
					<input  name="phone_num" value="<?php echo $phone_num; ?>">
				 </td>
			</tr>
			
			<tr>
			<td><span class="required">*</span> <?php echo "警务室电话"; ?></td>
			 <td>
					<input  name="dianhua" value="<?php echo $dianhua; ?>">
				 </td>
			</tr>
			
			<tr>
			<td><span class="required">*</span> <?php echo "警号"; ?></td>
			 <td>
					<input  name="police_code" value="<?php echo $police_code; ?>">
				 </td>
			</tr>
			
			
			
			<tr>
			<td><span class="required">*</span> <?php echo "地址"; ?></td>
			 <td>
					<textarea cols="50" rows="5" name="address" ><?php echo $address; ?></textarea>
				 </td>
			</tr>
			
			<tr>
			<td><span class="required">*</span> <?php echo "职位"; ?></td>
			 <td>
					<input  name="police_position" value="<?php echo $police_position; ?>">
				 </td>
			</tr>
				<tr>
			<td><span class="required">*</span> <?php echo "所属社区"; ?></td>
			 <td>
			 	<select name="community_id">
			 		<option value="-1">请选择</option>
			 		<?php foreach ($communitys as $community) { ?>
			 			<option value="<?php echo $community['community_id']?>" <?php if($community_id==$community['community_id']){?> selected="selected" <?php }?> ><?php echo $community['title'];?></option>
			 		<?php  }?>
			 	</select>
				 </td>
			</tr>
			<tr>
			<td><span class="required">*</span> <?php echo "概要"; ?></td>
			 <td>
					<textarea cols="50" rows="5" name="summary" ><?php echo $summary; ?></textarea>
				 </td>
			</tr>
			<tr>
			<td><span class="required">*</span> <?php echo "描述"; ?></td>
			 <td>
					<textarea cols="50" rows="20" name="description" ><?php echo $description; ?></textarea>
					<input name="url" value="community/auxiliary" type="hidden" />
				 </td>
			</tr>
			
			<tr>
			<td>图片</td>
			<td class="left" id="picurl">
				  <div class="image"><img src="<?php echo $abPic; ?>" alt="" id="thumb" /><br />
                  <input type="hidden" name="pic_url" value="<?php echo $pic_url; ?>" id="image" />
                  <a onclick="image_upload('image', 'thumb');"><?php echo $text_browse; ?></a>
                  &nbsp;&nbsp;|&nbsp;&nbsp;
                  <a onclick="$('#thumb').attr('src', '<?php echo $no_image; ?>'); $('#image').attr('value', '');"><?php echo $text_clear; ?></a>
                  </div>
				 </td>
			</tr>
			
        </table>
      </form>
      </div>
  </div>
  </div>
  
  
<script type="text/javascript" src="view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<link rel="stylesheet" type="text/css" href="view/javascript/jquery/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<script type="text/javascript"><!--
$('.fancybox').fancybox({
	width: 860,
	height: 360,
	autoDimensions: true,
	scrolling: 'no',
	onClosed:function() {
		//location.reload();
	}
});
//--></script> 
  <script type="text/javascript" src="view/javascript/ckeditor/ckeditor.js"></script> 
<script type="text/javascript"><!--
CKEDITOR.replace('description', {
	filebrowserBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserImageBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserFlashBrowseUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserImageUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>',
	filebrowserFlashUploadUrl: 'index.php?route=common/filemanager&token=<?php echo $token; ?>'
});
//--></script> 


<script type="text/javascript"><!--
function image_upload(field, thumb) {
	$('#dialog').remove();
	
	$('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="index.php?route=common/filemanager&token=<?php echo $token; ?>&field=' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
	
	$('#dialog').dialog({
		title: '<?php echo $text_image_manager; ?>',
		close: function (event, ui) {
			if ($('#' + field).attr('value')) {
				$.ajax({
					url: 'index.php?route=common/filemanager/image&token=<?php echo $token; ?>&image=' + encodeURIComponent($('#' + field).attr('value')),
					dataType: 'text',
					success: function(text) {
						$('#' + thumb).replaceWith('<img src="' + text + '" alt="" id="' + thumb + '" />');
					}
				});
			}
		},	
		bgiframe: false,
		width: 800,
		height: 400,
		resizable: false,
		modal: false
	});
};
//--></script> 

<?php echo $footer;?>
